package com.yc.cloud.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 订单
 *
 * @author Yancy
 * @since 2024-01-03
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("orders")
@ApiModel(value = "Order对象", description = "订单")
public class Order extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("订单编号")
    @TableField("order_no")
    private String orderNo;

    @ApiModelProperty("第三方订单编号")
    @TableField("transaction_id")
    private String transactionId;

//    @ApiModelProperty("订单类型, 1:购买会员")
//    @TableField("type")
//    private String type;

    @ApiModelProperty("产品ID")
    @TableField("product_id")
    private Long productId;

    @ApiModelProperty("支付类型 1:支付宝 2:微信")
    @TableField("pay_type")
    private String payType;

    @ApiModelProperty("支付时间")
    @TableField("pay_time")
    private LocalDateTime payTime;

    @ApiModelProperty("周期,按月")
    @TableField("duration")
    private Integer duration;

    @ApiModelProperty("金额")
    @TableField("price")
    private Integer price;

    @ApiModelProperty("订单描述")
    @TableField("description")
    private String description;

    @ApiModelProperty("订单状态：0:未支付 1:已支付 2:支付失败  3:支付中")
    @TableField("status")
    private Integer status;


    public static final String ORDER_NO = "order_no";

    public static final String TYPE = "type";

    public static final String PAY_TYPE = "pay_type";

    public static final String PAY_TIME = "pay_time";

    public static final String DURATION = "duration";

    public static final String PRICE = "price";

    public static final String DESCRIPTION = "description";

    public static final String STATUS = "status";

}
